package br.com.atenas.sigop.dao;

import java.sql.Connection;
import java.sql.PreparedStatement;

import br.com.atenas.sigop.dto.RelacionaEmpDTO;

public class RelacionaEmpDAO {

	private String tabela = " SIGOP.TB008_RELACIONA_EMP ";

	public void gravar(RelacionaEmpDTO relacEmp, Connection conn) throws Exception{
		String sql = " INSERT INTO"+ tabela + "(NU_EMPRESTIMO, NU_MATERIAL, NU_TPMATERIAL) " +
		" VALUES (?,?,?)";
		PreparedStatement ps = conn.prepareStatement(sql);
		int index = 1;
		ps.setBigDecimal(index++, relacEmp.getNuEmprestimo());
		ps.setBigDecimal(index++, relacEmp.getNuMaterial());
		ps.setBigDecimal(index++, relacEmp.getNuTpMaterial());
		ps.executeUpdate();
		ps.close();
		conn.close();
	}
	
	
}
